import $http from '@/assets/js/http'
//视频管理api

//视频列表
export function videoList(param){
	return $http.get('/manage/video/list',{
		params:{
			title:param.title,
			type:param.type,
			beginDate:param.beginDate,
			endDate:param.endDate,
			pageIndex:param.pageIndex,
			pageSize:param.pageSize,
			isRecommend:param.isRecommend
		}
	})
}

//视频新增
export function videoAdd(param){
	return $http.post('/manage/video/release',{
			title:param.title,
			videoUrl:param.videoUrl,
			videoTime:param.videoTime,
			headImg:param.headImg,
			type:param.type,
			isRecommend:param.isRecommend//	是否推荐视频：0否、1是
	})
}

//视频编辑
export function videoEdit(param){
	return $http.post('/manage/video/update',{
			id:param.id,
			title:param.title,
			videoUrl:param.videoUrl,
			headImg:param.headImg,
			videoTime:param.videoTime,
			type:param.type,
			isRecommend:param.isRecommend//	是否推荐视频：0否、1是
	})
}


//视频删除
export function videoDelete(delId){
	return $http.post('/manage/video/delete',{
			id:delId
	})
}

//推荐视频-设置推荐
export function videoRecommend(id) {
    return $http.post('/manage/video/recommend', {
        id:id,
        isRecommend:1,
    });
}

//推荐视频-取消推荐
export function videoRecommendChance(id) {
    return $http.post('/manage/video/recommend', {
        id:id,
        isRecommend:0,
    });
}

